package com.xuanwu.ai.flow.utils;

import com.xuanwu.ai.core.domain.SessionInfo;

public class ThreadSessionUtil {
    private static final ThreadLocal<SessionInfo> threadSession = new ThreadLocal<>();
    /**
     * 获取session
     *
     * @param
     * @return sessionInfo
     */
    public static SessionInfo get(){
        return threadSession.get();
    }
    /**
     * 设置session
     *
     * @param sessionInfo
     * @return
     */
    public static void set(SessionInfo sessionInfo){
        threadSession.set(sessionInfo);
    }

    /**
     * 移除session
     *
     * @param
     * @return
     */
    public static void remove(){
        threadSession.remove();
    }

}
